package codestyle.evaluator;

import java.util.List;
import java.util.Random;

@title(name = "rnd", description = "rpwt")
public class RandomBad extends AbstractEvaluator {

	/**
	 * the probability each line bad
	 */
	protected Float p;

	public RandomBad(int gradeDeductedPerBad, int maxDeduct) {
		super(gradeDeductedPerBad, maxDeduct);
	}

	@Override
	public void evaluate(List<String> lines) {
		badLines.clear();
		for (int i = 0; i < lines.size(); i++)
			if (new Random().nextFloat() < p)
				badLines.add(i);
	}

}
